import java.util.Scanner;

public class Extend03 {
    public static void main(String[] args){
        int count = 0;
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入瓜子数量");
        int num = sc.nextInt();

        while(num != 1){
            if(num % 2 == 0){
                num /= 2;
            }else {
                num = num*3 + 1;
            }
            count++;
        }

        System.out.println("经过"+count+"次变化,瓜子数量为1");
    }
}
